<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>程董发红包</title>

    <link href="../../css/bootstrap.css" rel="stylesheet" type="text/css" />
     <link href="../../css/hc/click.css" rel="stylesheet" type="text/css" /> 
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=2.0, user-scalable=yes" />
    
</head>
<body style="height: 100%;background:url(../../img/pad/padbg.png) ;background-size:cover;text-align: center;">
    <img style="width: 400px;z-index: 333;margin-top: 20%" src="../../img/pad/bag.png">
    <div class="col-lg-4 col-md-4 col-sm-2 col-xs-2" style="text-align: center;margin-top: 15% ;margin-left: 35%;">
        <img id="btnclsid"  class="btncls" style="animation: pulse 1s infinite alternate;width: 200px;" onclick="sendMassage()" src="../../img/pad/btn.png">
    </div>
	<div id="mainIP" hidden="hidden"><%=httpUrl%>|<%=socketUrl%></div>
</body>
<script type="text/javascript" src="../../js/li/jquery.min.js"></script>
<script src="../../js/plugins/layer/layer.js"></script>
<script type="text/javascript">
    var connectIP = $("#mainIP").html();
    var ip =connectIP.split("|")[0];

    function sendMassage(){
        $.ajax({
            url:ip+'management/clicktorubbonus?bonus=chen',
            type:'get',
            async:false,
            success:function(data){
                removeclickFun();
                window.setTimeout(addclickFun,1000*60*3)
                layer.msg("消息发送成功");
            },
            error:function(){
                layer.msg("消息发送失败");
            }
        })
    }
    function addclickFun(){
        $("#btnclsid").show();
        $("#btnclsid").attr("onclick","sendMassage();");
        $("#btnclsid").css({
            "animation": "pulse 1s infinite alternate"
        })
    }
    function removeclickFun(){
        $("#btnclsid").removeAttr("onclick");
        $("#btnclsid").css({
            "animation": "flyaway 2s 1 "
        });
        window.setTimeout(function(){
            $("#btnclsid").hide();
        },2000) 
    }
</script>
</html>